import { ConfigType } from "@/api/config"; import { routing } from "@/i18n/routing"; import { server } from "@/utils/server"; import clsx from "clsx"; import { Metadata, Viewport } from "next"; import { NextIntlClientProvider } from "next-intl"; import { getMessages } from "next-intl/server"; import { Inter as FontSans } from "next/font/google"; import { notFound } from "next/navigation"; import { ReactNode } from "react"; import "../editor.scss"; import "../globals.scss"; import { Providers } from "./providers"; // 加载字体 const fontSans = FontSans({ subsets: ["latin"], variable: "--font-sans", }); export const viewport: Viewport = {}; export const metadata: Metadata = { title: { template: "%s | BCWin777", default: "BCWin777", }, keywords: ["BCWin777"], description: "The home of over 30 million players", appleWebApp: { statusBarStyle: "black", }, formatDetection: { email: false, address: false, telephone: false, }, referrer: "no-referrer", other: { viewport: [ "width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0," + " viewport-fit=cover ", ], }, }; interface Og { description: string; keywords: string; title: string; url: string; address: string; } interface System extends ConfigType { og: Og; } const getSystemReq = () => { return server.request({ url: "/v1/api/front/system/configs", method: "POST", }); }; export default async function LocaleLayout({ children, params: { locale }, }: { children: ReactNode; params: { locale: string }; }) { if (!routing.locales.includes(locale as any)) { notFound(); } const messages = await getMessages(); const { data } = await getSystemReq(); // console.log(data) return ( {/* */} {/* */} {/* */} {/* */} {children} ); }